namespace devtm.Aop.Emit
{
    using System;
    using Mono.Cecil;
    

    [Serializable]
    public class ObjectCreateExpression : EmitExpression
    {
        private EmitTypeReference createType;
        private EmitExpressionCollection parameters;

        public ObjectCreateExpression()
        {
            this.parameters = new EmitExpressionCollection();
        }

        public ObjectCreateExpression(EmitTypeReference createType, params EmitExpression[] parameters)
        {
            this.parameters = new EmitExpressionCollection();
            this.CreateType = createType;
            this.Parameters.AddRange(parameters);
        }


        public ObjectCreateExpression(TypeReference createType, params EmitExpression[] parameters)
        {
            this.parameters = new EmitExpressionCollection();
            this.CreateType = new EmitTypeReference(createType);
            this.Parameters.AddRange(parameters);
        }

        public EmitTypeReference CreateType
        {
            get
            {
                if (this.createType == null)
                {
                    this.createType = new EmitTypeReference();
                }
                return this.createType;
            }
            set
            {
                this.createType = value;
            }
        }

        public EmitExpressionCollection Parameters
        {
            get
            {
                return this.parameters;
            }
        }



        public override System.Collections.Generic.IEnumerable<Mono.Cecil.Cil.Instruction> Compile()
        {
            throw new NotImplementedException();
        }
    }
}
